package com.usian.controller;

import com.usian.pojo.Zhanghao;
import com.usian.service.ZhanghaoService;
import com.usian.vo.YuanVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import javax.websocket.server.PathParam;
import java.util.ArrayList;

@Controller
@RequestMapping("/zhanghao")
public class ZhanghaoController {
    @Autowired
    private ZhanghaoService zhanghaoService;

    @RequestMapping("/deng")
    public  String lu(String name, String mima, Model model){
        Zhanghao hao = zhanghaoService.findHao(name,mima);
        if (hao!=null){

            return "redirect:/yuan/fin";
        }

      return "delu";
    }
    @RequestMapping("/addl")
    public String dl(Zhanghao zhanghao){
        zhanghaoService.add(zhanghao);
        return "redirect:/zhanghao/de";
    }

    @RequestMapping("/de")
    public  String lu3(){
        return "delu";
    }
    @RequestMapping("/zhu")
    public  String lu5(){
        return "zhuce";
    }
}
